package cyc.learn.mode.decorator.demo1;

public class DecoratorFilter1 implements Filterable {

    private Filterable filterable;

    public DecoratorFilter1(Filterable filterable) {
        this.filterable = filterable;
    }

    private void beforeMethod() {
        System.out.println("before");
    }

    private void afterMethod() {
        System.out.println("after");
    }

    @Override
    public void filter() {
        beforeMethod();
        filterable.filter();
        afterMethod();
    }
}
